# -*- coding: utf-8 -*-
#  客户信息页面
class customerInfoPage():
    def __init__(self, driver):
        self.driver = driver
    ###############查询页面###################
    #保单号
    def policyNo(self):
        return self.driver.find_element_by_xpath("//*[@id='searchBar']/div[1]/div/div[1]/div[2]/div/input")
    #查询按钮
    def check(self):
        return self.driver.find_element_by_xpath("//*[@id='searchBar']/div[2]/button[2]/span")
    #查询结果
    def checkResult(self):
        return self.driver.find_element_by_xpath("//*[@id='curLeftBox']/div/div[2]/div[2]/div/div[1]/div[3]/table/tbody/tr[1]/td[1]/div/span")

    ###############纸质单录入-客户信息################
    #姓名
    def name(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[1]/div[1]/div/div[2]/span/div[2]/input")
    #性别
    def sex(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[1]/div[2]/div/div[2]/span/div[2]/div[1]/input")
    def sexM(self):
        return self.driver.find_element_by_xpath("/html/body/div[2]/div[1]/div[1]/ul/li[2]/span")
    def sexF(self):
        return self.driver.find_element_by_xpath("/html/body/div[2]/div[1]/div[1]/ul/li[1]/span")
    #婚姻状态
    def maritalStatus(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[1]/div[3]/div/div[2]/span/div[2]/div[1]/input")
    def maritalStatus01(self):
        return self.driver.find_element_by_xpath("/html/body/div[3]/div[1]/div[1]/ul/li[1]/span")
    def maritalStatus02(self):
        return self.driver.find_element_by_xpath("/html/body/div[3]/div[1]/div[1]/ul/li[2]/span")


    #国籍
    def contry(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[1]/div[4]/div/div[2]/span/div[2]/div/input")
    #中国
    def china(self):
        return self.driver.find_elements_by_xpath("//*[text()='中国']")[1]
    #台湾
    def taiwai(self):
        return self.driver.find_elements_by_xpath("//*[text()='中国台湾']")[1]
    #香港
    def HongKong(self):
        return self.driver.find_elements_by_xpath("//*[text()='中国香港']")[1]
    #澳门
    def Macao(self):
        return self.driver.find_elements_by_xpath("//*[text()='中国澳门']")[1]
    #出生日期
    def Birth(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[2]/div[1]/div/div[2]/div/span/div[2]/input")
    #证件类型
    def idType(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[2]/div[2]/div/div[2]/span/div[2]/div/input")
    #居民身份证
    def idType01(self):
        return self.driver.find_elements_by_xpath("//*[text()='居民身份证']")[1]
    #户口簿
    def idType02(self):
        return self.driver.find_elements_by_xpath("//*[text()='户口簿']")[1]
    #中国人民解放军军官证
    def idType03(self):
        return self.driver.find_elements_by_xpath("//*[text()='中国人民解放军军官证']")[1]
    #出生医学证明
    def idType04(self):
        return self.driver.find_elements_by_xpath("//*[text()='出生医学证明']")[1]
    #普通护照
    def idType05(self):
        return self.driver.find_elements_by_xpath("//*[text()='普通护照']")[1]
    #港澳同胞回乡证
    def idType06(self):
        return self.driver.find_elements_by_xpath("//*[text()='港澳同胞回乡证（通行卡）']")[1]
    #台湾居民定居证
    def idType07(self):
        return self.driver.find_elements_by_xpath("//*[text()='台湾居民定居证']")[1]
    #证件号码
    def idNum(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[2]/div[3]/div/div[2]/span/div[2]/input")
    #证件有效期长期
    def idEnd(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[2]/div[4]/div/div[2]/div/label[1]/span[1]/span")
    #证件有效期日期
    def idDate(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[2]/div[4]/div/div[2]/span/div[2]/input")
    #联系电话
    def Tel(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[3]/div[1]/div/div[2]/span/div[2]/input")
    #邮箱
    def Mail(self):
        return self.driver.find_element_by_xpath(
            "//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[3]/div[2]/div/div[2]/span/div[2]/input")
    #居住地址
    def address(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[4]/div[1]/div/div[2]/span[1]/span/span/span")
    def provice(self,listdata):
        return self.driver.find_element_by_xpath("//*[text()='%s']" % listdata)
    def city(self,listdata):
        return self.driver.find_element_by_xpath("//*[text()='%s']" % listdata)
    def area(self,listdata):
        return self.driver.find_element_by_xpath("//*[text()='%s']" % listdata)
    #详细地址
    def addressDetail(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[4]/div[1]/div/div[2]/span[2]/div[2]/input")
    #邮编
    def postCode(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[4]/div[1]/div/div[2]/span[3]/div[2]/input")
    #工作单位地址
    def workAddresss(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[4]/div[2]/div/div[2]/span/span/span")
    #工作省
    def workProvice(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    #工作市
    def workCity(self, listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    #工作区
    def workArea(self, listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    #工作详细地址
    def workDetail(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[4]/div[2]/div/div[2]/div[1]/input")
    #工作邮编
    def workPost(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[4]/div[2]/div/div[2]/div[2]/input")
    #职业代码
    def workerName(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[5]/div[3]/div/div[2]/span/div[2]/div[1]/input")
    #职业名称结果
    def workerResult(self, listdata):
        return self.driver.find_elements_by_xpath("//*[contains(text(),'%s')]" % listdata)[-1]

    #年收入
    def income(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[5]/div[4]/div/div[2]/span/div[2]/input")
    #家庭年收入
    def familyIncome(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[6]/div[4]/div/div[2]/span/div[2]/input")
    #学历
    def education(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[7]/div[1]/div/div[2]/span/div[2]/div/input")
    def educationConfirm(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    #单位名称
    def company(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[1]/div/div/div[2]/div[7]/div[2]/div/div[2]/span/div[2]/input")

    ###############纸质单录入-客户信息-主被保人信息################
    #与投保人关系
    def relation(self, listdata):
        return self.driver.find_element_by_xpath("//*[text()='%s']" % listdata)
     #其他关系
    def otherRelation(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[1]/div/div/div[2]/div[2]/input")
    #姓名
    def protectName(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[1]/div[1]/div/div[2]/span/div[2]/input")
    #性别
    def protectSex(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[1]/div[2]/div/div[2]/span/div[2]/div[1]/input")
    def protectSexConfirm(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    #婚姻状态
    def protectMarry(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[1]/div[3]/div/div[2]/span/div[2]/div[1]/input")
    #选择婚姻状态
    def protectmarryConfirm(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    #国籍
    def protectContry(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[1]/div[4]/div/div[2]/span/div[2]/div/input")
    #选择国籍
    def protectcontryConfirm(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    #出生日期
    def protectBirth(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[2]/div[1]/div/div[2]/div/span/div[2]/input")
    #证件类型
    def protectidType(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[2]/div[2]/div/div[2]/span/div[2]/div[1]/input")
    #选择证件类型
    def protectidTypeCon(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    #证件号码
    def protectidNum(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[2]/div[3]/div/div[2]/span/div[2]/input")
    #证件有效期
    def protectidend(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[2]/div[4]/div/div[2]/div/label[1]/span[1]/span")
    def protectiddate(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[2]/div[4]/div/div[2]/span/div[2]/input")
    #联系电话
    def protectTel(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[3]/div[1]/div/div[2]/span/div[2]/input")
    #邮箱
    def protectMail(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[3]/div[2]/div/div[2]/span/div[2]/input")
    #居住地址
    def protectAddress(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[4]/div[1]/div/div[2]/span[1]/span/span/span")
    def protectProvice(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    def protectCity(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    def protectArea(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    #详细地址
    def protectAddressDetail(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[4]/div[1]/div/div[2]/span[2]/div[2]/input")
    #邮编
    def protectPost(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[4]/div[1]/div/div[2]/span[3]/div[2]/input")
    #工作地址
    def proworkAdd(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[4]/div[2]/div/div[2]/span/span/span")
    def proworkProvice(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    def proworkCity(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    def proworkArea(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    def proworkAddDetail(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[4]/div[2]/div/div[2]/div[1]/input")
    #邮编
    def proworkPost(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[4]/div[2]/div/div[2]/div[2]/input")
    #职业代码
    def proworkerName(self):
        return self.driver.find_element_by_xpath(
            "//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[5]/div[3]/div/div[2]/span/div[2]/div[1]/input")
    # 职业名称结果
    def proworkerResult(self,listdata):
        return self.driver.find_elements_by_xpath("//*[contains(text(),'%s')]" % listdata)[-1]
    #年收入
    def protectIncome(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[5]/div[4]/div/div[2]/span/div[2]/input")
    #学历
    def proeducation(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[7]/div[1]/div/div[2]/span/div[2]/div[1]/input")
    def proeducationConfirm(self,listdata):
        return self.driver.find_elements_by_xpath("//*[text()='%s']" % listdata)[-1]
    #单位名称
    def protectCompany(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[2]/div/div/div[2]/div[2]/div[7]/div[2]/div/div[2]/span/div[2]/input")

    ##################纸质单录入-客户信息-保单通讯地址########################
    #保单通讯地址
    def policyAddress(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[3]/div[2]/div/div/div/div[2]/div[1]/div[1]/input")
    #保单通讯地址确认
    def policyAddressConfirm(self,listdata):
        return self.driver.find_element_by_xpath("//*[text()='%s']" % listdata)
    #下一步
    def next(self):
        return self.driver.find_element_by_xpath("//*[@id='app']/div/div[3]/div[4]/button[1]/span")






